#ifndef __CC_BY_PROTOCOL_H__
#define __CC_BY_PROTOCOL_H__

#include "PacketBase.h"

enum 
{
	NONE_PROTOCOL = 0,
	PBA_PROTOCOL = 6
};

#ifdef __USE_PBA_PROTOCOL__
#define  DEFAULT_PROTOCOL    (PBA_PROTOCOL)
#else
#error  "please set protocol"
#endif

#pragma pack(1)
struct PBAHead
{
	unsigned char m_magic[2];
	unsigned char m_ver;
	unsigned char m_crc;
	unsigned int m_cmd;
	unsigned short m_dsttype;
	unsigned short m_srctype;
	unsigned int m_dstid;
	unsigned int m_srcid;
	unsigned int m_seq;
	unsigned int m_bitflag;
	unsigned int m_datalen;
	char m_data[];

	PBAHead()
	{
		m_magic[0] = 0xFE;
		m_magic[1] = 0x01;
		//m_magic[2] = 0xF6;
		//m_magic[3] = 0x9B;
		m_ver = 0;
		m_crc = 0;
		m_cmd = 0;
		m_dsttype = 0;
		m_srctype = 0;
		m_dstid = 0;
		m_srcid = 0;
		m_seq = 0;
		m_bitflag = 0;
		m_datalen = 0;
	}
};
#pragma pack()

#endif